<div id="seats_num" data-table-num=<%= params[:table_num] %> data-table-pernum=<%= params[:table_pernum] %> class="hidden"></div>

<% breadcrumb :seat_show %>

<div class="row">
  <div class="col-lg-12">
    <div class="ibox float-e-margins">
      <div class="ibox-title">
        <h5>座位安排</h5>
      </div>
      <div class="ibox-content">

      <div class="table-responsive">
        <table class="table table-hover" style="width: 100%">
          <caption align='center'>主席台</caption>
          <% for i in 1..params[:table_num].to_i+1 %>
            <tr>
              <% for j in 1..params[:table_pernum].to_i %>
                <% seat = @session.seats.seat_position_is(i, j).first %>
                <td>
                <% if seat.present? %>
                  <button type="button" class="seat" data-seat-id="<%= seat.id %>"><%= seat.attendee.name %></button>
                <% else %>
                  <button type="button">&nbsp&nbsp&nbsp&nbsp</button>
                <% end %>
                </td>
              <% end %>
            </tr>
          <% end %>
        </table>
       </div>
      </div>
    </div>
  </div>
</div>

<% content_for :script do %>
  <%= javascript_include_tag 'seat_show' %>
<% end %>